﻿function KaoHeBiao(model) {
    return {
        mkhbid: model ? model.mkhbid : 0, //考核表Id
        mkhbmc: model ? model.mkhbmc : "", //考核表名称
        cjsj: model ? model.cjsj : "", //创建时间
        cjsjstr: model ? model.cjsjstr : "", //创建时间字符串
        sssj: model ? model.sssj : "", //所属时间
        sssjstr: model ? model.sssjstr : "", //所属时间字符串
        username: model ? model.username : "", //所属人账号
        khbzt: model ? model.khbzt : 0, //考核表状态
        MyKaoHeBiaoOnes: model ? new GetMyKaoHeBiaoOnes(model) : [], //考核表一级
        MyKaoHeBiaoFujiaxiangs: model ? new GetMyKaoHeBiaoFujiaxiangs(model) : [], //考核表附加项
        xingming: model ? model.xingming : "", //姓名
        ksid: model ? model.ksid : 0, //科室Id
        ksmc: model ? model.ksmc : "", //科室名称
        zwid: model ? model.zwid : 0, //职务Id
        zwmc: model ? model.zwmc : "", //职务名称
        MyKaoHeZongJie: model ? model.MyKaoHeZongJie : new zongjieone()
    };
}
function GetMyKaoHeBiaoOnes(model) {
    var arr = [];
    if (model && model.MyKaoHeBiaoOnes) {
        $(model.MyKaoHeBiaoOnes).each(function (i, item) {
            arr.push(new MyKaoHeBiaoOne(item));
        });
    }
    return arr;
}
function MyKaoHeBiaoOne(model) {
    return {
        oneid: model ? model.oneid : 0,
        mbid: model ? model.mbid : 0,
        mbnr: model ? model.mbnr : "",
        sx: model ? model.sx : 0,
        fz: model ? model.fz : 0,
        htmlstr: model ? decodeURI(model.htmlstr.replace("nameattr", "name=" + model.oneid)) : "",
        onetype: model ? Getonetype(model) : "",
        mbtype: model ? model.mbtype : 0,
        MyKaoHeBiaoTwos: model ? new GetMyKaoHeBiaoTwos(model) : []
    };
}
function Getonetype(model) {
    var onetype = "";
    if (model && model.htmlstr) {
        var obj = $(decodeURI(model.htmlstr));
        onetype = obj.find("input").attr("type");
    }
    return onetype;
}
function GetMyKaoHeBiaoTwos(model) {
    var arr = [];
    if (model && model.MyKaoHeBiaoTwos) {
        $(model.MyKaoHeBiaoTwos).each(function (i, item) {
            arr.push(new MyKaoHeBiaoTwo(item));
        });
    }
    return arr;
}
function MyKaoHeBiaoTwo(model) {
    return {
        twoid: model ? model.twoid : 0,
        mbid: model ? model.mbid : 0,
        mbnr: model ? model.mbnr : "",
        fz: model ? model.fz : 0,
        sx: model ? model.sx : 0,
        htmlstr: model ? model.htmlstr : "",
        zf: model ? model.zf : 0,
        gzjhkssj: model ? model.gzjhkssj : "",
        gzjhkssjstr: model ? model.gzjhkssjstr : "",
        gzbz: model ? model.gzbz : "",
        gzjhwcsj: model ? model.gzjhwcsj : "",
        gzjhwcsjstr: model ? model.gzjhwcsjstr : "",
        gzjhwcqk: model ? model.gzjhwcqk : "",
        bz: model ? model.bz : "",//备注->用来记录插入子项目的操作员
        MyKaoHeBiaoTwoPingFens: model ? new GetMyKaoHeBiaoTwoPingFens(model) : [],
        MyKaoHeBiaotwoFuJianses: model ? new GetMyKaoHeBiaotwoFuJianses(model) : [],
        IsEdit: model ? model.IsEdit : false,
        zp: model ? model.zp : 0,
        gzcdrid: model ? model.gzcdrid : "",
        gzcdr: model ? model.gzcdr : "",
        zycd: model ? model.zycd : "",
        xiangguangongzuoji: model ? new Getxiangguangongzuoji(model.xiangguangongzuoji) : [],
        xlid: model ? model.xlid : "",
        zhou: model ? model.zhou : -1,// 全年第几周
        lyid: model ? model.lyid : 4,// 来源ID
        lyxingming: model ? model.lyxingming : "",// 来源人
        twolx: model ? model.twolx : 5,// 任务类型;系统 = 1,上系指派 = 2,他人指派 = 3,继承未完成 = 4,自己新建立 = 5
        ljcs: model ? model.ljcs : 1,// 累计次数
        Iswc: model ? model.Iswc : false// 是否完成
    };
}
function GetMyKaoHeBiaoTwoPingFens(model) {
    var arr = [];
    if (model && model.MyKaoHeBiaoTwoPingFens) {
        $(model.MyKaoHeBiaoTwoPingFens).each(function (i, item) {
            arr.push = new MyKaoHeBiaoTwoPingFen(model);
        });
    }
    return arr;
}
function MyKaoHeBiaoTwoPingFen(model) {
    return {
        pfid: model ? model.pfid : 0,
        pfusername: model ? model.pfusername : "",
        cjsj: model ? model.cjsj : "",
        fz: model ? model.fz : 0
    };
}
function GetMyKaoHeBiaoFujiaxiangs(model) {
    var arr = [];
    if (model && model.MyKaoHeBiaoFuJiaBiaos) {
        $(model.MyKaoHeBiaoFuJiaBiaos).each(function (i, item) {
            arr.push(new MyKaoHeBiaoFujiaxiang(item));
        });
    }
    return arr;
}
function MyKaoHeBiaoFujiaxiang(model) {
    return {
        fjxid: model ? model.fjxid : 0,
        xmid: model ? model.xmid : 0,
        xmmc: model ? model.xmmc : "",
        xmfz: model ? model.xmfz : 0,
        cjrusername: model ? model.cjrusername : ""
    };
}
function GetMyKaoHeBiaotwoFuJianses(model) {
    var arr = [];
    if (model && model.MyKaoHeBiaotwoFuJianses) {
        $(model.MyKaoHeBiaotwoFuJianses).each(function (i, item) {
            arr.push(new MyKaoHeBiaoTwoFuJian(item));
        });
    }
    return arr;
}
function MyKaoHeBiaoTwoFuJian(model) {
    return {
        fjid: model ? model.fjid : 0,
        path: model ? model.path : "",
        fjmc: model ? model.fjmc : "",
        bz: model ? model.bz : ""
    };
}
function Getxiangguangongzuoji(model) {
    var arr = [];
    if (model && model.xiangguangongzuoji) {
        $(model.xiangguangongzuoji).each(function (i, item) {
            arr.push(new xiangguangongzuo(item));
        });
    }
    return arr;
}
function xiangguangongzuo(model) {
    return {
        xggzid: model ? model.xggzid : 0,
        xggz: model ? model.xggz : ""
    };
}
function zongjieone(model) {
    return {
        zjmc: model ? model.zjmc : "",
        Zongjietwos: model ? new GetZongjietwos(model.Zongjietwos) : []
    };
}
function GetZongjietwos() {
    var arr = [];
    if (model && model.Zongjietwos) {
        $(model.Zongjietwos).each(function (i, item) {
            arr.push(new zongjietwo(item));
        });
    }
    return arr;
}
function zongjietwo(model) {
    return {
        zjtowid: model ? model.zjtowid : 0,
        zongjielx: model ? model.zongjielx : 0,
        zongjielxstr: model ? model.zongjielxstr : "",
        zongjienr: model ? model.zongjienr : ""
    };
}